savePermission = function(formName) {
	formName.submit();	
}
checkAllPerm = function(me, i) {	
	var checked = $(me).attr('checked');
	for (var j=0; j<7; j++) {
		if(checked)
			$('#pPerm'+j+'_'+i).attr('checked', checked);
		else
			$('#pPerm'+j+'_'+i).attr('checked', false);
	}
	if (!checked) {
		$('#pPerm6_'+i).attr('checked', false);
	}
}
uncheckAllPerm = function(me, i) {	
	var checked = $(me).attr('checked');	
	var intCheckAll 	= 0;
	var intCheckView	= 0;
	if (!checked) {		
		$('#pPerm6_'+i).attr('checked', false);
	}
	else {
		for (var j=0; j<6; j++) {
			if($('#pPerm'+j+'_'+i).attr('checked')) {
				intCheckAll++;
			}			
		}		
		if(intCheckAll == 6) {
			$('#pPerm6_'+i).attr('checked', checked);
		}		
	}
}